package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpActivityBoardModifyContractLinePageUtil extends SeleniumPageUtil {
	
	public final static By ABMCL_LINK_SAVE = By.id("ctl44_btnSave");
	public final static By ABMCL_LINK_DELETE = By.id("ctl44_btnDelete");
	public final static By ABMCL_LINK_CLOSE = By.id("ctl44_btnDone");
	public final static By ABMCL_TD_HEADER_TEXT = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[1]/tbody/tr/td[2]");
	
	public final static By ABMCL_SPAN_TITLE = By.id("ctl44_Label1");
	public final static By ABMCL_TD_CONTRACT_ID_LABEL = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[2]/td[1]");
	public final static By ABMCL_TD_SERIAL_NUMBER0 = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[3]/td[1]");
	public final static By ABMCL_INPUT_SERIAL_NUMBER_TYPE_AHEAD = By.id("ctl44_txtLine");
	public final static By ABMCL_TD_TYPE = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[4]/td[1]");
	
	public final static By ABMCL_TD_FIELD = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[6]/td[1]/b");
	public final static By ABMCL_TD_CURRENT_VALUE = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[6]/td[2]/b");
	public final static By ABMCL_TD_NEW_VALUE = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[6]/td[3]/b");
	
	public final static By ABMCL_TD_START_DATE = By.xpath("//*[@id='ctl44_trStartDate']/td[1]"); 
	public final static By ABMCL_INPUT_START_DATE = By.id("ctl44_txtReqLineStartDate");
	public final static By ABMCL_IMG_START_DATE = By.id("ctl44_imgReqLineStartDate");
	public final static By ABMCL_TD_END_DATE = By.xpath("//*[@id='ctl44_trEndDate']/td[1]");
	public final static By ABMCL_INPUT_END_DATE = By.id("ctl44_txtReqEndDate");
	public final static By ABMCL_IMG_END_DATE = By.id("ctl44_imgReqEndDate");
	public final static By ABMCL_TD_SLA_TERMS = By.xpath("//*[@id='ctl44_trSLATerm']/td[1]");
	public final static By ABMCL_CHECK_SLA_TERMS = By.id("ctl44_chkSLAAll");
	public final static By ABMCL_SELECT_SLA_TERMS = By.id("ctl44_cboSLATermID");
	public final static By ABMCL_TD_MONTHLY_RATE = By.xpath("//*[@id='ctl44_trReqRate']/td[1]");
	public final static By ABMCL_INPUT_MONTHLY_RATE = By.id("ctl44_txtReqRate");
	
	/* Asset Information */
	public final static By ABMCL_SPAN_ASSET_INFORMATION = By.id("ctl44_lblAssetInfo");
	public final static By ABMCL_LINK_CONFIG = By.id("ctl44_btnConfig");
	public final static By ABMCL_TD_CHANGE_CONFIG = By.xpath("//*[@id='ctl44_trReqConfig']/td[1]");
	public final static By ABMCL_CHECK_CHANGE_CONFIG = By.id("ctl44_chkReqConfig");
	public final static By ABMCL_TD_SERIAL_NUMBER = By.xpath("//*[@id='ctl44_trSerialNumber']/td[1]");
 	public final static By ABMCL_INPUT_SERIAL_NUMBER = By.id("ctl44_txtSerialNumber");
	public final static By ABMCL_TD_ASSET_NAME = By.xpath("//*[@id='ctl44_trAssetName']/td[1]");
	public final static By ABMCL_INPUT_ASSET_NAME = By.id("ctl44_txtAssetName");
	
	public final static By ABMCL_TD_SITE_ADDRESS = By.xpath("//*[@id='ctl44_trAddress']/td[1]");
	public final static By ABMCL_LINK_NEW_SITE_ADDRESS = By.id("ctl44_btnAddressNew");
	public final static By ABMCL_INPUT_SITE_ADDRESS = By.id("ctl44_txtAddress");
	
	public final static By ABMCL_SPAN_SITE_CONTRACT = By.id("ctl44_lblSiteContact");
	public final static By ABMCL_LINK_NEW_SITE_CONTRACT = By.id("ctl44_btnContactNew");
	public final static By ABMCL_INPUT_SITE_CONTRACT = By.id("ctl44_txtContact");
	
	public final static By ABMCL_TD_ASSET_DESCRIPTION = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[18]/td[1]");
	public final static By ABMCL_SPAN_ASSET_DESCRIPTION = By.id("ctl44_lblAssetDescription");
	
	public final static By ABMCL_TD_COMMENTS = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[19]/td[1]");
	public final static By ABMCL_TEXTAREA_COMMENTS = By.id("ctl44_txtComment");
	
	public static void waitForPageToLoad(){
		SeleniumUtil.waitOnElements(new By[]{
			ABMCL_LINK_SAVE, ABMCL_LINK_DELETE, ABMCL_LINK_CLOSE, ABMCL_IMG_START_DATE, ABMCL_IMG_END_DATE, 
			ABMCL_TEXTAREA_COMMENTS
		});
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(ABMCL_IMG_START_DATE));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(ABMCL_IMG_END_DATE));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(ABMCL_TEXTAREA_COMMENTS));
		SeleniumUtil.isEnabled(SeleniumUtil.findElement(ABMCL_TEXTAREA_COMMENTS));
	}
}
